using System;
using Newtonsoft.Json;

namespace BuildWheel
{
    public class FileInfo
    {
        [JsonIgnore]
        public int layer;
        [JsonIgnore]
        public Folders parent;
        public string n;
        [JsonIgnore]
        public string nameToLow;

        public string Id()
        {
            string _id = n;
            GetLayerID(this, ref _id);
            return _id;
        }

        private void GetLayerID(FileInfo info, ref string id)
        {
            if (info.parent != null && info.parent.layer != -1)
            {
                id = $"{info.parent.n} > {id}";
                GetLayerID(info.parent, ref id);
            }
        }
    }
}